package com.jprocms.module.cms.dal.mysql.imgblockpic;

import java.util.*;

import com.jpro.framework.common.pojo.PageResult;
import com.jpro.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.jpro.framework.mybatis.core.mapper.BaseMapperX;
import com.jprocms.module.cms.dal.dataobject.content.ContentDO;
import com.jprocms.module.cms.dal.dataobject.imgblockpic.ImgblockPicDO;
import org.apache.ibatis.annotations.Mapper;
import com.jprocms.module.cms.controller.admin.imgblockpic.vo.*;
import org.apache.ibatis.annotations.Param;

/**
 * 飘窗图片 Mapper
 *
 * @author jprocms
 */
@Mapper
public interface ImgblockPicMapper extends BaseMapperX<ImgblockPicDO> {

    default PageResult<ImgblockPicDO> selectPage(ImgblockPicPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ImgblockPicDO>()
                .eqIfPresent(ImgblockPicDO::getSectorId, reqVO.getSectorId())
                .orderByDesc(ImgblockPicDO::getSort).orderByDesc(ImgblockPicDO::getId));
    }

    List<ImgblockPicDO> listBySectorId(@Param("sectorId") Long sectorId);

}